<?php
        @header("Content-Type:text/html;charset=utf-8");
    $connect=mysqli_connect("localhost","root","root","2101");
    mysqli_query($connect,"set names utf8");
    mysqli_query($connect,"set character set utf-8");
    $sqlstr="SELECT id,name,class,chinese,math,eg,chinese+math+eg as total FROM `study` order by total desc limit 0,5";
    $querystr=mysqli_query($connect,$sqlstr);
    $list=array();
    $arr=array();
    while($result=mysqli_fetch_assoc($querystr)){
    array_push($list,$result);
    }
    if($list>0){
        $arr["status"]=true;
       $arr["detail"]="查询成功"；
        $arr["list"]=$list;
        }else{
          $arr["status"]=false;
         $arr["detail"]="查询四百"；
         $arr["list"]=array();
         }
?>